
package com.amigo.online.provider.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.amigo.online.provider.manager.mapper.AdvTanSourceTblMapper;
import com.amigo.online.provider.manager.model.entity.AdvTanSourceTbl;
import com.amigo.online.provider.manager.service.AdvTanSourceTblService;

/**
 * <code>AdvTanSourceTblServiceImpl.java</code>
 * <p>
 *
 * </p>
 * <p>
 *
 * @author LuChen
 * @version 1.0
 * @company Amigo
 * @time 2018年11月29日 上午11:00:52
 * @lastUpdate 无
 * </p>
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AdvTanSourceTblServiceImpl implements AdvTanSourceTblService {


    @Autowired
    private AdvTanSourceTblMapper advTanSourceTblMapper;

    @Override
    public AdvTanSourceTbl addAdvTanSourceApply(AdvTanSourceTbl advTanSourceTbl) {
        advTanSourceTbl.setStatus(0);
        if (advTanSourceTblMapper.insert(advTanSourceTbl) > 0) {
            advTanSourceTbl = advTanSourceTblMapper.selectOne(advTanSourceTbl);
            return advTanSourceTbl;
        }
        return null;
    }

    @Override
    public boolean updateAdvTanSource(AdvTanSourceTbl advTanSourceTbl) {
        if (advTanSourceTblMapper.updateById(advTanSourceTbl) > 0) {
            return true;
        }
        return false;
    }

}

